package com.lhk.appframework.net.packet;

import java.util.HashMap;
import java.util.Map;

public class NetRequestPacket {

	private NetReqPacketHeader header;
	private Map<Object, Object> body;
	private Map<Object, Object> data;

	private NetRequestPacket() {
		header = new NetReqPacketHeader();
		body = new HashMap<Object, Object>();
		data = new HashMap<Object, Object>();
	}

	public static NetRequestPacket newNetRequest(String command) {
		NetRequestPacket req = new NetRequestPacket();
		req.getHeader().setCommand(command);
		return req;
	}

	public NetReqPacketHeader getHeader() {
		return header;
	}

	public void putBody(Object key, Object value){
		body.put(key, value);
	}
	public void putData(Object key, Object value){
		data.put(key, value);
	}
}
